<!--列表重复-->
{if $get.tid >1 }
<!--获取接口地址的参数-->
{php $idtid=$get.tid;}
{else}
{php $idtid=$_GET['qid'];}
{/if}
{php $quanid=$_GET['quanid'];}

{table table=1_quan_guanli order=inputtime quanid=$quanid page=1 pagesize=200 return=ttt}
{$tt.cid}

<!--图片-->

<div class="d-col-md-8-10">
	<div class="d-yuanjiao-10 d-kuan d-waigao-20 d-beijing-baise d-bianhua-10 ">
		<!--头部-->
		<div class="d-kuan d-buhuanhang  d-xia-10">
			<!--头部-->
			<div class="d-yuanjiao-10 d-quxian-0">
				<a href="{d_huiyuan_url($ttt.uid)}">
					<img src="{dr_avatar($ttt.uid)}" width="40" height="40" class="d-yuanjiao-50"/>
				</a>
			</div>
			<div class="d-zuo-10 d-kuan">
				<div class="d-jiacu d-buhuanhang">
					<div class="d-jiacu d-quxian-0">
						<a href="{d_huiyuan_url($ttt.uid)}">
						{php $userweixin=\Phpcmf\Service::M()->db->table('member_oauth')->where('uid', $ttt.uid)->get()->getRowArray();}
						{php $user=dr_member_info($ttt.uid);}
							{if $user.name}
								{$user.name}
							{elseif $userweixin.nickname}
								{$userweixin.nickname}
							{else}
								{$user.username}
							{/if}
						</a>
					</div>
					{loop $user.group $tt}
						{if $tt.group_icon}<div class="d-zuo-10"><img src="{$tt.group_icon}" width="60" height="15" class="d-yuanjiao-50"/></div>{/if}
					{/loop}
					
				</div>
				<div class="d-zitiyanse-hui ">
					
					{loop $user.group $tt}
						{$tt.group_name}
					{/loop}
					
				</div>
			</div>
			
		</div>
		<!--列表内容-->
		
		<div class="d-kuan d-xia-10 d-quxian-0 d-beijing-hei-d9 d-neikuang-10 d-yuanjiao-5">
			<!--标题-->
			<div class="d-wenzi-14 d-zitiyanse-hui {if !$t.title} d-zitiyanse-hei{/if} d-wenzi-12" ><span >选择用户组</span>：
				{php $guanlibiao = '1_quan_guanli';}
				{table table=1_quan_form_yonghuzu order=inputtime cid=$quanid kaiguan=1 leixing=1 page=1 pagesize=200 return=yh}
				    {php $guanliyishenqing = \Phpcmf\Service::M()->db->table($guanlibiao)->where('uid', $ttt.uid)->get()->getRowArray();}
					<a id="guanzhu_list_{$yh.id}_{$ttt.uid}" class="d-zuo-10 tag_shenheguanli d-yuanjiao-5 d-neikuang-2-5 {if $guanliyishenqing['guanlizu']==$yh.id} d-beijing-hei d-zitiyanse-bai{/if}" data-id="{$yh.id}" data-uid="{$ttt.uid}">{$yh.title}</a>
				{/table}
			</div>
			
		</div>
		<a class="tag_zhuangtai {if $ttt.zhuangtai ==1}d-beijing-hui{/if}  d-yuanjiao-5 d-neikuang-5-10 d-wenzi-12" id="zhuangtai_list_1" data-id="{$ttt.uid}" data-ztid="1" data-uid="{$ttt.uid}" class="guanzhu_list">通过</a>
		<a class="tag_zhuangtai {if $ttt.zhuangtai ==2}d-beijing-hui{/if} d-zuo-10  d-yuanjiao-5 d-neikuang-5-10 d-wenzi-12" id="zhuangtai_list_2" data-id="{$ttt.uid}" data-ztid="2" data-uid="{$ttt.uid}" class="guanzhu_list">不通过</a>
		
		<a class="tag_zhuangtai d-zuo-10  d-yuanjiao-5 d-neikuang-5-10 d-wenzi-12"  id="zhuangtai_list_4" data-id="{$ttt.uid}" data-ztid="4" data-uid="{$ttt.uid}" class="guanzhu_list">删除</a>
		<a class="{if $ttt.zhuangtai ==10}d-beijing-hui{/if}  d-yuanjiao-5 d-neikuang-5-10 d-wenzi-12" id="zhuangtai_list_0" data-id="{$ttt.uid}" data-ztid="0" data-uid="{$ttt.uid}" class="guanzhu_list">申请中</a>
		
		
	</div>
</div>


{/table}
<script type="text/javascript">
	// 管理员申请
	$(".tag_shenheguanli").click(function(){
		var id = $(this).data("id");
		var quanid = $(this).data("quanid");
		var uid = $(this).data("uid");
		$.get("{dr_url_prefix('index.php')}?s=quan&c=son&m=guanlizu&guanlizuid="+id+"&quanid="+{$quanid}+"&uid="+uid, function(data){
			dr_cmf_tips(data.code, data.msg.value + data.msg.jifen);
			 
			if (data.msg.value=="选择成功") {
				$('#guanzhu_list_'+id+'_'+uid).addClass('d-beijing-hei d-zitiyanse-bai');
			}else{
				
			}
		}, 'json');
	});
	
	// 状态
	$(".tag_zhuangtai").click(function(){
		var id = $(this).data("id");
		var quanid = $(this).data("quanid");
		var uid = $(this).data("uid");
		var ztid = $(this).data("ztid");
		$.get("{dr_url_prefix('index.php')}?s=quan&c=son&m=guanlizuzhuangtai&guanlizuid="+id+"&quanid="+{$quanid}+"&uid="+uid+"&ztid="+ztid, function(data){
			dr_cmf_tips(data.code, data.msg.value + data.msg.jifen);
			 
			if (data.msg.status==1) {
				$('#zhuangtai_list_1').addClass('d-beijing-hui');
				$('#zhuangtai_list_2').removeClass('d-beijing-hui');
				$('#zhuangtai_list_0').removeClass('d-beijing-hui');
			}else if(data.msg.status==2){
				$('#zhuangtai_list_1').removeClass('d-beijing-hui');
				$('#zhuangtai_list_2').addClass('d-beijing-hui');
				$('#zhuangtai_list_0').removeClass('d-beijing-hui');
			}
		}, 'json');
	});
	
</script>